<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // async 函数
        async function fn(){
            return new Promise((resolve,reject)=>{
                resolve("success");
            })
        }

        const result = fn();

        result.then(r=>{
            console.log(r);
        }).catch(error=>{
            console.log(error);
        })
    </script>
</body>
</html>